#!/bin/bash -e

function info() {
echo Usage: `basename $0` 'in.vcf'
exit 2
}

while getopts  ":p:f:" opt; do
	case  $opt  in
		p) out_prefix=$OPTARG;;
		f) suffix=$OPTARG;;
		*) info;;
	esac
done
shift $(($OPTIND - 1))


if [ $# -lt 1 ]; then info; fi

. $var


echo extractField
$java_run/snpsift extractField $1 CHROM POS ID FILTER "ANN[0].GENE" "ANN[0].TRID" "ANN[0].RANK" "ANN[0].HGVS_C" "ANN[0].HGVS_P" "ANN[0].EFFECT" "ANN[0].IMPACT" dbNSFP_Interpro_domain dbNSFP_Uniprot_acc dbNSFP_SIFT_score dbNSFP_Polyphen2_HVAR_score dbNSFP_CADD_raw dbNSFP_CADD_raw_rankscore dbNSFP_CADD_phred dbNSFP_ExAC_AC dbNSFP_ExAC_AF dbNSFP_ExAC_Adj_AC dbNSFP_ExAC_Adj_AF dbNSFP_ExAC_AFR_AC dbNSFP_ExAC_AFR_AF dbNSFP_ExAC_AMR_AC dbNSFP_ExAC_AMR_AF dbNSFP_ExAC_EAS_AC dbNSFP_ExAC_EAS_AF dbNSFP_ExAC_FIN_AC dbNSFP_ExAC_FIN_AF dbNSFP_ExAC_NFE_AC dbNSFP_ExAC_NFE_AF dbNSFP_ExAC_SAS_AC dbNSFP_ExAC_SAS_AF > $out_prefix.extract_f.txt

sed -i '1s/^#//;1s/dbNSFP_//g;1s/ANN\[0\]\.//g' 1.extract_f.txt

. $cmd_done